package com.flycms.module.solution.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.flycms.esmodule.model.EsSolution;
import com.flycms.module.soft.model.Case;
import com.flycms.module.soft.model.Soft;
import com.flycms.module.solution.model.Solution;

/**
 *
 * <br/>Copyright 2020
 * <br/>All rights reserved
 * @author 沁言訫語
 * @version 2020年3月10日
 * @Date 2020年3月10日
 */

@Repository
public interface SolutionDao {

    int addSolution(Solution solution);
    
    int updateSolution(Solution solution);
    
    int removeSolution(Solution solution);
    
    Solution querySolutionById(Integer id);
    
    List<Solution> getSolutionList(
            @Param("categoryId") Integer categoryId,
            @Param("title") String title,
            @Param("pageIndex") Integer pageIndex,
            @Param("pageSize") Integer pageSize);
    
    int getSolutionCount(@Param("categoryId") Integer categoryId,
            @Param("title") String title);
    
    int addSolutionCaseRel(@Param("ids") List<Integer> ids,
            @Param("solutionId") Integer solutionId);
    
    int removeSolutionCaseRel(@Param("solutionId") Integer solutionId,
            @Param("caseId") Integer caseId);
    
    int addSolutionProductRel(@Param("ids") List<Integer> ids,
            @Param("solutionId") Integer solutionId);
    
    int removeSolutionProductRel(@Param("solutionId") Integer solutionId,
            @Param("productId") Integer productId);
    
    List<Soft> getSolutionProductRel(@Param("solutionId") Integer solutionId,
            @Param("pageIndex") Integer pageIndex,
            @Param("pageSize") Integer pageSize);
    
    int getSolutionProductCount(@Param("solutionId") Integer solutionId);
    
    List<Case> getSolutionCaseRel(@Param("solutionId") Integer solutionId,
            @Param("pageIndex") Integer pageIndex,
            @Param("pageSize") Integer pageSize);
    
    int getSolutionCaseRelCount(@Param("solutionId") Integer solutionId);

    List<EsSolution> queryAll();
    
}
